function request(paras) {
    var url = location.href;
    var paraString = url.substring(url.indexOf("?")+1,url.length).split("&");
    var paraObj = {}
    for (i=0;j=paraString[i];i++){
        paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length);
    }
    var returnValue = paraObj[paras.toLowerCase()];
    if(typeof(returnValue)=="undefined"){
        return "";
    }else{
        return returnValue;
    }
}

function SendCode(){
    var val = $("#phone")[0].value;
    console.log(val);
    //1.验证手机号码是否正确
    var verification = /^1[3|4|5|7|8]\d{9}$/;
    if (verification.test(val)){
        alert("格式正确");
    }else {
        alert("手机号码格式不正确");
    }

}

function Send_api(val) {
    var tel = $("#phone").val();
    $.get("/phone/fasongyanzhengma?tel=" + tel, function (result) {
        alert(result);
    })
}

function Jump_page (param){         //跳转页面
    if (param == "app_open"){
        if (app_open == 1){
            window.location.href="client.html"
        }else{
            $(".one").hide();
            $(".ones").show();
            $(".onees").hide();
        }
    }
    if (param == "email_open"){
        if (email_open == 1){
            window.location.href="email?authkey=" + request("authkey");
        }else{
            $(".twos").hide();
            $(".two").hide();
            $(".twoes").show();
        }
    }
    if (param == "tel_open"){
        if (tel_open == 1){
            window.location.href="phone?authkey=" + request("authkey");
        }else{
            $(".threes").hide();
            $(".three").hide();
            $(".threeis").show();
        }
    }
}


